package zw_301_400.zw_344_反转字符串;

class Solution {
    public void reverseString(char[] s) {
        int left = 0, right = s.length-1;
        while (left < right){
            char tmp = s[left];
            s[left++] = s[right];
            s[right--] = tmp;
        }

//        int n = s.length;
//        for (int left = 0, right = n - 1; left < right; ++left, --right) {
//            char tmp = s[left];
//            s[left] = s[right];
//            s[right] = tmp;
//        }

    }
}
